package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.*;
import one.stand.response.CompanyPhotoResponse;
import one.stand.response.CompanyResponse;
import one.stand.response.DynamicResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author zrh
 */
@RestController
@RequestMapping("companyPhoto")
public class CompanyPhotoController extends BaseController {

    /**
     * 分页查询企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("selectCompanyPhotoPage")
    public ResultModel<Map<String, Object>> selectCompanyPhotoPage(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.selectCompanyPhotoPage(request);
    }

    /**
     * 查询企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("selectCompanyPhoto")
    public ResultModel<List<CompanyPhotoResponse>> selectCompanyPhoto(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.selectCompanyPhoto(request);
    }

    /**
     * 广告图管理数量查询
     *
     * @param request
     * @return
     */
    @PostMapping("selectTypeNum")
    public ResultModel<List<Map<String, Object>>> selectTypeNum(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.selectTypeNum(request);
    }

    /**
     * 新增企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("insertCompanyPhoto")
    public ResultModel<Boolean> insertCompanyPhoto(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.insertCompanyPhoto(request);
    }

    /**
     * 上移/下移企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("moveCompanyPhoto")
    public ResultModel<Boolean> moveCompanyPhoto(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.moveCompanyPhoto(request);
    }

    /**
     * 删除企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("delCompanyPhoto")
    public ResultModel<Boolean> delCompanyPhoto(@RequestBody CompanyPhotoRequest request) {
        return companyPhotoService.delCompanyPhoto(request);
    }
}
